package unv.esiag.uchiha.topics;

import java.io.Serializable;
import java.util.Vector;

public class STopic implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private String name;
	private String fullName;
	private  Vector<STopic> topics;
	private String ior;
	private Serializable serializable;
	public STopic(String name, Serializable serializable) {
		this.name = name;
		this.topics = new Vector<STopic>();
		this.serializable = serializable;
	}
	public void setFullName(String fullName) {
		this.fullName = fullName;
	}
	public String getFullName() {
		return fullName;
	}
	public Serializable getSerializable() {
		return serializable;
	}
	public void setSerializable(Serializable serializable) {
		this.serializable = serializable;
	}
	public int size(){
		return topics.size();
	}
	public STopic get(int index){
		return topics.get(index);
	}
	public void setIor(String ior) {
		this.ior = ior;
	}
	public String getIor() {
		return ior;
	}
	public void addTopic(String name, Serializable serializable){
		topics.add(new STopic(name, serializable));
	}
	public void addTopic(STopic topic){
		topics.add(topic);
	}
	public String getName() {
		return name;
	}
	@Override
	public String toString() {
		if(this.name.equals("Rooot")){
			return "Rooot";
		}
		return name + "(" + this.serializable + ")";
	}
}
